<?php

namespace App\Console\Commands;

use App\Utils\LogUtil;
use Illuminate\Console\Command;

class DemoTime extends Command
{
    //日志板块
    private const LOG_MODULE = 'ActivityStartTime';

    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'command:DemoTime';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     */
    public function __construct()
    {
        //日志统一写入
        register_shutdown_function([new LogUtil, 'close']);
        LogUtil::getInstance('Time/');//设置日志存入通道
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        LogUtil::info('开始处理', self::LOG_MODULE, __FUNCTION__);
        // 要执行的业务
        LogUtil::info('处理结果', self::LOG_MODULE, __FUNCTION__);
        return Command::SUCCESS;
    }
}
